import fetch from 'fetch'

export default {
  // 课程统计
  classSchedule (params) {
    return fetch({
      url: '/v1/user/train/comment/findClassSchedule',
      params
    })
  },
  // 课程学员
  studentSchedule (params) {
    return fetch({
      url: '/v1/user/train/comment/findStudentForSchedule',
      params
    })
  },
  // 课程章节
  lessonSchedule (params) {
    return fetch({
      url: '/v1/user/train/comment/listTrainStudentScheduleByPage',
      params
    })
  },
  // 获取评论
  getComment (params) {
    return fetch({
      url: '/v1/user/train/comment/get',
      params
    })
  },
  // 提交评论
  saveComment (data, context) {
    return fetch({
      method: 'POST',
      url: '/v1/user/train/comment/save',
      data,
      context
    })
  },
  // 更新评论
  updateComment (data, context) {
    return fetch({
      method: 'POST',
      url: '/v1/user/train/comment/update',
      data,
      context
    })
  },
  // 删除评论
  delComment (data, context) {
    return fetch({
      method: 'POST',
      url: '/v1/user/train/comment/delete',
      data,
      context,
      options: { successMsg: 'none' }
    })
  }
}
